From f8894e8d6bd3a09414b4193632174bfdfa921a3c Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 24 Dec 2013 00:43:42 -0800 Subject: [PATCH] Disabled, unticked "Leave redirect" checkbox when redirect impossible Disabled the "Leave redirect" checkbox on Special:MovePage when redirect is impossible because of the content model. Bug: 58017 Change-Id: Ibbc5caace749662d51b9ebd4554234d79b7a887c --- includes/specials/SpecialMovepage.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/includes/specials/SpecialMovepage.php b/includes/specials/SpecialMovepage.php index 253e6cc37d..9193b5d8e4 100644 --- a/includes/specials/SpecialMovepage.php +++ b/includes/specials/SpecialMovepage.php @@ -351,7 +351,16 @@ class MovePageForm extends UnlistedSpecialPage { ); } - if ( $user->isAllowed( 'suppressredirect' ) && $handler->supportsRedirects() ) { + if ( $user->isAllowed( 'suppressredirect' ) ) { + if ( $handler->supportsRedirects() ) { + $isChecked = $this->leaveRedirect; + $options = array(); + } else { + $isChecked = false; + $options = array( + 'disabled' => 'disabled' + ); + } $out->addHTML( " @@ -360,7 +369,8 @@ class MovePageForm extends UnlistedSpecialPage { $this->msg( 'move-leave-redirect' )->text(), 'wpLeaveRedirect', 'wpLeaveRedirect', - $this->leaveRedirect + $isChecked, + $options ) . " " -- 2.20.1